package org.pixelami.twisted.spread.flavors
{
	import org.pixelami.twisted.spread.jelly.Jelly;
	import org.pixelami.twisted.spread.jelly.Jellyable;
	
	public class Serializable extends Jellyable
	{
		static private var _uid:uint = 0;
		
		static private function id(obj:*):uint
		{
			return _uid ++;
		}
		
		
		/*
		An object that can be passed remotely.

	    I am a style of object which can be serialized by Perspective
	    Broker.  Objects which wish to be referenceable or copied remotely
	    have to subclass Serializable.  However, clients of Perspective
	    Broker will probably not want to directly subclass Serializable; the
	    Flavors of transferable objects are listed below.
	
	    What it means to be \"Serializable\" is that an object can be
	    passed to or returned from a remote method.  Certain basic types
	    (dictionaries, lists, tuples, numbers, strings) are serializable by
	    default; however, classes need to choose a specific serialization
	    style: L{Referenceable}, L{Viewable}, L{Copyable} or L{Cacheable}.
	
	    You may also pass C{[lists, dictionaries, tuples]} of L{Serializable}
	    instances to or return them from remote methods, as many levels deep
	    as you like.
	    */
		
		public function Serializable()
		{
		}
		
		
    

    	public function processUniqueID():uint
    	{
	        /*
	        Return an ID which uniquely represents this object for this process.
	
	        By default, this uses the 'id' builtin, but can be overridden to
	        indicate that two values are identity-equivalent (such as proxies
	        for the same object).
	        */

        	return Jelly.id(this)
     	}

	}
}